extends ../common/layout
block content
  div(class='container')
    div(class='row-fluid show-grid')
      div(class='span8')
         h4 
           span #{user.nick}
           small &nbsp;&nbsp;(#{user.profile})
         hr 
         if(userDiaryList.length)
           h4 #{user.nick}的日记
            small (#{diaryCount})
           div(class='Diary-wrap')
             each item,i in userDiaryList 
               h5 
                 a(href="/diary/#{item._id}") #{item.created_user}的日记 
                 if(item.title)
                   a(href='/diary/#{item._id}') 
                     small #{item.title} 
                   a(href="/user/#{item.pageurl}/notebook/#{item.notebook}") 
                     small [#{item.bookname}] 
                   if(item.privacy == 1)
                     small [仅自己可见] 
                 else
                   a(href="/user/#{item.pageurl}/notebook/#{item.notebook}") 
                     small [#{item.bookname}] 
                   if(item.privacy == 1)
                     small [仅自己可见] 
                   if(item.weather)
                     small [天气:#{item.weather}] 
                   if(item.mood)
                     small [心情:#{item.mood}] 
                   if(item.location)
                     small [地点:#{item.location}]
               div(class='Diary-content')
                  if(item.img)
                      img(src='#{item.img}')
                  p #{item.content}
               div(class='bar') #{item.created_at}
                 small #{item.commentcount}回复 
                 if(isSelf)
                   form(action='/diary/remove',method='post') 
                     input(type='hidden',value='#{item._id}',name='id')
                     div(class="btn-group")
                      a(class='btn btn-mini',href='/diary/edit/#{item._id}') Edit
                      button(class='btn btn-danger btn-mini',type='submit') Del 
           !{pag}
         else
           p 额，他还神马都没有写过……
      div(class='span4')
         div(class='User-box well')
          dl(class='pl')
           dt 
             img(src='#{user.avatarUrl}',title='#{user.nick}')
           dd 
             p #{user.nick} 于 #{user.created_at} 加入
              dd
                div(class='btn-group')
                  if(session.is_login)
                    if(!isSelf)
                      if(user.isFriend)
                        a(href='#',class='J_removeFriend btn btn-danger btn-small',target_id='#{user._id}') 解除关注
                      else if(!isSelf)
                        a(href='#',class='J_addFriend btn btn-primary btn-small',target_id='#{user._id}') 关注此人
                  a(href="/todo/#{user._id}",class="btn btn-small",title="#{user.nick}的TODOS") TODOS
                  a(href='/user/rss/#{user._id}',class="btn btn-small",target='_blank') RSS
           if(user.about)
            p(class='User-about') !{user.about}
         div(class='row Note-list')
          h4 #{user.nick}的日记本
            small (#{notebooks.length})
          ul 
            each book,i in notebooks
             li 
              span(class='bookcover',style='background:##{book.bgcolor};')
              a(title="#{book.name}",href="/user/#{user._id}/notebook/#{book._id}/1") #{book.name} (#{book.size})
         div(class='row Friends-list')
          h4 #{user.nick}关注的人 
            a(href='/user/followed/#{user._id}') (#{user.firends.length})
          if(Followed.length)
            ul
              each follow,i in Followed
                li
                  a(href='/user/profile/#{follow._id}',title='#{follow.nick}') 
                    img(src='#{follow.avatarUrl}',alt='#{follow.nick}')
                  span #{follow.nick}
          else
             p 额，他还没有关注任何人
         div(class='row Friends-list')
          h4 关注#{user.nick}的人 
            a(href='/user/follows/#{user._id}') (#{FollowsCount})
          if(Follows.length)
            ul
              each friend,i in Follows
                li
                  a(href='/user/profile/#{friend._id}',title='#{friend.nick}') 
                    img(src='#{friend.avatarUrl}',alt='#{friend.nick}')
                  span #{friend.nick}
          else
             p 额，还没有任何人关注他
    include ../common/footer
